This invention relates to an apparatus for converting and reconverting color signals between two different color spaces, and more particularly to an apparatus where reconverted color signals are confined in their allowed dynamic ranges when, for example, R, G, B color signals are converted into corresponding Y, Cr, Cb color signals, subjected to data compression and data decompression, and reconverted into R, G, B color signals.
FIG. 1 shows a block diagram of an embodiment of this invention, which will be used for describing a prior art.
CPU 1 converts color signals according to the program stored beforehand in control ROM 2 using control RAM 3 as a working memory. Color signals in R, G, B color space are input and stored temporarily in control RAM 3 and converted into corresponding signals in Y, Cr, Cb color space by the conversion program. Converted color signals are registered in a filing device 4 after compressed by a picture data compressor 5. Picture data to be displayed on a display 8 are read out from the filing device 4, decompressed by a picture data decompressor 6 and are reconverted into corresponding color signals in R, G, B color space by the reconversion program. The reconverted R, B, G color signals are stored in a frame buffer memory 7 to be displayed on the display 8.
Conversion of color signals in R, G, B color space into corresponding signals in Y, Cr, Cb color space or reconversion vice versa should be completed in a high speed.
As prior arts developed for this purpose, there are Japanese patents laid open as preliminary patent publication No. 210771/'84 (hereafter called the first prior art) and No. 288684/'92 (hereafter called the second prior art).
As for conversion and reconversion of color signals between R, G, B color space and Y, Cr, Cb color space, following formula (1) and formula (2) are applied. ##EQU1##
It takes, however, a lot of time to convert and reconvert color signals by calculating these formulas.
To eliminate these calculations, conversion tables are used as shown in FIG. 7. In FIG. 7, 1a, 1b, and 1c are input terminals of R, G and B signal, 4a, 4b, and 4c are output terminals of Y, Cr, and Cb signal, and 3a, 3b and 3c are corresponding conversion tables, for example.
Conversion or reconversion tables as shown in FIG. 7, however, need a lot of memory.
When R, G, B, Y, Cr and Cb signals have digital values of 8 bits, for example, table 3a has addresses of 24 bits (2.sup.24) and data in each address needs 8 bits and so total amount of memory for table 3a, 3b and 3c require 402653184 bits.
The first and the second prior arts are developed for economizing memory volume.
In the first prior art, the number of addresses of 3a, 3b and 3c is reduced as far as possible. Formula (1) shows that G has the greatest effect on Y and that the effect of G on Y is 1/2 and that of B is smaller than 1/4 of the effect of G on Y. So, when the number of addresses provided for G is 8 bits, the number of addresses provided for R can be reduced to upper 7 bits and the number of addresses provided for B to upper 6 bits with little decrease of accuracy. In the first prior art, the memory volume for conversion tables is thus economized.
In the second prior art, output data are obtained by calculating from intermediate data that are read out from intermediate conversion tables provided instead of full conversion tables, thus economizing the memory volume for tables.
FIG. 8 illustrates data format read out from the intermediate conversion tables in the second prior art.
Table 3a in FIG. 7, for example, has addresses of 24 bits corresponding to the value of R, G and B, and outputs 8 bits data of Y=0.2963R+0.5926G+0.1111B that is registered in each address and has the value calculated according to the formula (1).
In FIG. 8, data 81 is read out from an intermediate conversion table provided for R where data of Y=0.2963R, Cr=0.7037R and Cb=-0.2963R is registered in each 8 bits address corresponding to the value of R. Data area is composed of a word of 32 bits and 30 of which are used and assigned for Y, Cb and Cr each by 10 bits.
Similarly, data 82 of Y=0.5926G, Cr=-0.5926G, Cb=-0. 5926G and data 83 of Y=0.1111B, Cr=-0.1111B and Cb=0.8889B are read out respectively from other conversion table. Data 84 that is obtained by adding data 82 and 83 to data 81 gives the output values of Y, Cr and Cb corresponding to the input value of R, G and B. Lower 10 bits of the data 84 gives the value of Y. The values of Cr and Cb are obtained from data 85 and data 86 that is obtained from data 84 by shifting right by 10 bits and 20 bits, respectively.
The first and the second prior arts are developed for economizing the memory volume of conversion tables and to reduce conversion and reconversion time.
However, in a heretofore known apparatus, including the first and the second prior arts, there remains another time consuming process.
FIG. 4 shows a flow chart illustrating reconversion process in a heretofore known apparatus and S401-S407 show steps of detailed processes.
At step S401, compressed data of Y, Cr, Cb in the filing device 4 are read out, decompressed at S402 and reconverted into R,G,B signals at S403. Values of R, G, B signals after reconversion may differ from those of original R, G, B signals and may go beyond their allowed dynamic ranges because fractions may be rounded off in the operations of conversion, reconversion, compression, decompression or in other processes. So, the values of signals after reconversion have to be checked and revised.
At step S404, the values of R, G, B signals after reconversion are checked if they go beyond their allowed dynamic range and the values which are out of ranges are replaced with the nearest values within their allowed dynamic ranges at step S405.
As signals developed in the frame buffer at step S407 are displayed directly on display 8, particularly the reconversion process as shown in FIG. 4 should be completed in a short time. However, the reconversion process in a heretofore known apparatus must be provided with time consuming steps S404 and S405.